/* GSStocksBalanBackACtion.java
 *
 * Project/Product: JZCG-XMBUS
 *
 * Modify Information:
 * =============================================================================
 *   Author	Date       Description
 *   ----------	---------- ---------------------------------------------------
 *   peng.ning	2008-9-2	First release
 *
 * Licensed Materials - Property of APEP
 * =============================================================================
 *    (C) COPYRIGHT Shanghai Auto Mart E-Procurement Co., Ltd. 2007 - 2008
 *    All Rights Reserved.
 *
 *    This software is the confidential and proprietary information of
 *    Shanghai Auto Mart E-Procurement Co., Ltd. ("Confidential Information").
 *    You shall not disclose such Confidential Information and shall use it only
 *    in accordance with the terms of the license agreement you entered into 
 *    with Shanghai Auto Mart E-Procurement Co., Ltd.
 *
 * Noties:
 * =============================================================================
 * 
 */

package com.hitrust.gs.action;

import java.util.ArrayList;

import com.hitrust.gs.bean.GSOperatorBean;
import com.hitrust.gs.business.GSBalanceProcessor;
import com.hitrust.gs.business.GSManufactureProcessor;
import com.hitrust.gs.business.GSOrganizationProcessor;
import com.hitrust.gs.business.GSStocksProcesser;
import com.hitrust.gs.form.GSStocksBanlanceForm;
import com.hitrust.gs.form.GSStocksFindForm;
import com.hitrust.gs.lib.GSBaseConstants;
import com.hitrust.gs.service.GSBaseAction;
import com.hitrust.gs.service.GSBaseForm;
import com.hitrust.gs.service.GSBaseManager;
import com.hitrust.gs.util.page.ResultProcess;
import com.hitrust.gs.vo.GSStocksVO;

public class GSStocksBalanBackACtion extends GSBaseAction {
    private GSStocksProcesser spro=new GSStocksProcesser();
    /* (non-Javadoc)
     * @see com.hitrust.gs.service.GSBaseAction#execute(com.hitrust.gs.service.GSBaseForm)
     */
    public String execute(GSBaseForm aForm) throws Exception {
        // TODO Auto-generated method stub
        GSStocksBanlanceForm stform=(GSStocksBanlanceForm) aForm;
        GSOperatorBean tOperBean = (GSOperatorBean)stform.getSession().getAttribute(GSBaseConstants.LOGIN);
        
        String tDeptId = aForm.getRequest().getParameter("dep");
        String tBalancYM =aForm.getRequest().getParameter("bal");
        String[] indexs=aForm.getRequest().getParameterValues("check");
        //执行查询
        try {
          //执行结算作废操作
            boolean tFlag = spro.balanceStocksBack(tDeptId,tBalancYM,tOperBean,indexs);
            if(tFlag){
                aForm.getRequest().setAttribute("message","结算信息暂不结算操作成功");
            }else{
                aForm.getRequest().setAttribute("message","结算信息暂不结算操作失败");
            }
            aForm.getRequest().setAttribute("requery", "true");
        } catch (Exception e) {
            aForm.getRequest().setAttribute("action", "A181205.do");
            throw e;
        }
        return GSBaseConstants.FORWARD_SUCCESS;
    }
}
